

# n=1
# for one in range(2,5):
#     n=(n+1)*2
#     print(n)

""""
1 1 2 3 5 8  13
4.func(2)+func(3)===>1+fun(3-2)+fun(3-1)===>1+1+1
5. func(3)+func(4)===>func(1)+func(2)  +  func(2)+func(3)==1+1+1+func(1)+func(2)=1+1+1+1+1=5
"""
# def func(n):
#     if n<= 2:
#         return 1
#     return func(n-2) + func(n-1)
# print(func(5))
#


"""
1
2*1
3*2*1
4*3*2*1
第一次执行 3*fdata(2) =====》  3*2*fdata(1)===》3*2*1
第二次执行  fdata（2）=2 * fdata（1）
"""
# def fdata(num):
#     if num >1:
#         return num * fdata(num-1)
#     else:
#         return  num
# print(fdata(3))
#
#
#
# def func1(n):
#     if n == 2:
#         return 2
#     if n == 3:
#         return  func(n-3) + func(n-2) + func(n-1)
# func1(10)
#
# list_dict={}
#
# def func1(n):
#     if list_dict.get(n):
#         return list_dict[n]
#     if n <=2:
#         return 1
#     list_dict[n]= func1(n-1) + func1(n-2)
#     return list_dict[n]
# print(func1(5))



# dict1={}
# def func(n):
#     if dict1.get(n):
#         return dict1[n]
#     if n <= 2:
#         return n
#     if n == 3:
#         return n + 1
#     dict1[n]=func( n - 1 ) + func( n - 2 ) + func( n - 3 )
#     return  dict1[n]
#
# print( func( 100 ) )



# from functools import wraps
# def demo(func):
#     dict1={}
#     @wraps(func)
#     def wrapper(*args,**kwargs):
#         if dict1.get(args):
#             return dict1[args]
#         res = dict1[args] = func(*args,**kwargs)
#         return res
#     return wrapper
#
# @demo
# def func(n):
#     if n <= 2:
#         return n
#     if n == 3:
#         return n + 1
#     return  func( n - 1 ) + func( n - 2 ) + func( n - 3 )
# print(func(2))



# 未加装饰器代码

def test1():
    '''test1...'''
    print('test1')

def test2():
    '''test2...'''
    print('test2')

print (test1.__name__)
print (test1.__doc__)

print (test2.__name__)
print (test2.__doc__)



def enter_home_admin():
    print("用户进入管理台页面成功")


def enter_home_page():
    print("用户进入首页成功")

def enter_my_page():
    print("用户进入我的页面成功")

print(enter_my_page.__name__)